import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { orderBaseStyle } from '../_common/style';
import { TitleCpt } from '../_components/TitleCpt';
import { TextareaCpt } from '../_components/TextareaCpt';
export class RemarkBlock extends Component {
	constructor(props) {
		super(props);
		let { edit } = this.props.data || {};
		this.state = {
			edit: edit || null
		}
	}
	componentWillReceiveProps (props) {
		let { edit } = props.data || {};
		this.setState({
			edit: edit || null,
		})
	}
	render () {
		let { title, placeholder, _writeTextFn, id, res, isEdit } = this.props.data || {};
		let { edit } = this.state;
		return (
			<View>
				<View style={[orderBaseStyle.box, orderBaseStyle.box2]}>
					{title ? <TitleCpt data={{ title }} /> : null}
					<TextareaCpt data={{ placeholder, _writeTextFn, id, edit, isEdit, res: res || 200 }} />
				</View>
			</View>
		)
	}
}

